package com.xy.blog.zipkin.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import zipkin2.server.internal.EnableZipkinServer;

/**
 * @author zanhonglei
 * @version V1.0
 * @Description:
 * @date 2020/1/7 10:44 下午
 */
@SpringBootApplication
@EnableZipkinServer //启动Zipkin服务端
public class ZipkinServerApplication implements CommandLineRunner {
    private static Logger logger = LoggerFactory.getLogger(ZipkinServerApplication.class);
    public static void main(String[] args) {
        SpringApplication.run(ZipkinServerApplication.class, args);
    }

    @Value("${server.port}")
    protected int port;

    @Override
    public void run(String... args) throws Exception {
        logger.info("Zipkin URL: http://localhost:" + port + "/");
    }
}
